#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>

QT_BEGIN_NAMESPACE
namespace Ui { class Widget; }
QT_END_NAMESPACE

class Widget : public QWidget
{
    Q_OBJECT

public:
    Widget(QWidget *parent = nullptr);
    ~Widget();

private slots:
    void on_pushButton_clicked();

private:
    Ui::Widget *ui;
};

class Student: public QObject
{
    Q_OBJECT
    Q_PROPERTY(QString name READ GetName WRITE SetName NOTIFY SignalNameChanged DESIGNABLE true)
    Q_PROPERTY(int age READ GetAge WRITE SetAge NOTIFY SignalAgeChanged DESIGNABLE true)

public:
    explicit Student(QObject *parent = nullptr);
    ~Student() = default;

public:
    void SetName(QString strName);
    QString GetName();

    void SetAge(int nAge);
    int GetAge();

    void testProperty();
    void testProperty2();

public slots:
    void SlotNameChanged(QString strName);
    void SlotAgeChanged(int nAge);

signals:
    void SignalNameChanged(QString);
    void SignalAgeChanged(int);

private:
    QString m_strName;
    int m_nAge;
};

#endif // WIDGET_H
